#ifndef STRING_H_
#define STRING_H_

#include "StringSegment.h"
#include "Object.h"
#include "ObjectList.h"

class String
{
	protected:
	
	StringSegment * segments;
	int numSegments;
	bool ownAnchor;
	bool checkCollision;
	float restLength;
	
	public:
	float GetLength();
	Vector2D * anchor;
	String(Vector2D * anchor, StringSegment * segments, int numSegments);
	String(Vector2D * anchor, int numSegments, float mass, float length, float stringConstant);
	String(Vector2D * anchor, StringSegment * segments, int numSegments, bool ownAnchor);
	String(Vector2D * anchor, int numSegments, float mass, float length, float stringConstant, bool ownAnchor);
	virtual ~String();
	virtual Vector2D Think(double elapsedTime);
	virtual void Draw();
	void AddGravitationalForce();
	void SetSpringConstant(float springConstant);
	void SetDampingConstant(float mass);
	virtual bool Collide(Object * object, Vector2D * location);
	virtual bool Collide(ObjectList * objectList, Object ** hitObject, Vector2D * location);
	virtual bool Collide(ObjectList * objectList, Object * ignoreMe, Object ** hitObject, Vector2D * location);
};
#endif /*STRING_H_*/

